
import { Form, Button, message, Modal} from 'antd';
import { useStore } from '../useStore';
import { useEffect } from 'react';
export const DetailTypeModal = ()=>{
  const [detailTypeModal,typeDetailData] = useStore((state)=>[
    state.detailTypeModal,
    state.typeDetailData
  ])
  const handleCancel = () =>{
    useStore.setState({detailTypeModal:{open:false}})
  }
  return(
    <Modal title={'指标类型详情'} open={detailTypeModal.open} onCancel={handleCancel} footer={[
      <Button key="back" onClick={handleCancel}>
        返回
      </Button>
    ]}>
      <Form
          labelCol={{ span: 5 }}
          wrapperCol={{ span: 19 }}
        >
        <Form.Item name="code" label={'类型编码'} rules={[{ required: true, message: '请填写类型编码!' }]}>
          <span>{typeDetailData.code}</span>
        </Form.Item>
        <Form.Item name="name" label={'类型名称'} rules={[{ required: true, message: '请填写类型名称!' }]} >
          <span>{typeDetailData.name}</span>
        </Form.Item>
        <Form.Item name="remark" label={'备注'} rules={[{ required: true, message: '请填写备注!' }]} >
          <span>{typeDetailData.remark}</span>
        </Form.Item>
      </Form>
    </Modal>
  )
}